// Copyright (c) 2016 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#{$all-buttons}, a.button {
  @include hab-button;
  appearance: none;
  border: 0;
  border-radius: $global-radius;
  cursor: pointer;
  display: inline-block;
  font-family: $base-font-family;
  font-size: rem(16);
  -webkit-font-smoothing: antialiased;
  padding: $small-spacing $base-spacing;
  text-decoration: none;
  transition: background-color $base-duration $base-timing;
  user-select: none;
  vertical-align: middle;
  white-space: nowrap;

  &:hover,
  &:focus {
    background-color: shade($action-color, 20%);
    color: #fff;
  }

  &:disabled,
  &.disabled {
    cursor: not-allowed;
    opacity: 0.5;

    &:hover {
      background-color: $action-color;
    }
  }

  &.danger {
    background-color: $hab-orange-dark;

    &:disabled,
    &.disabled {
      &:hover {
        background-color: $hab-orange-dark;
      }
    }
  }

  &.cta {
    @include primary-button($hab-orange, $hab-orange-dark);
  }

  &.secondary {
    @include secondary-button;

    &:focus,
    &:hover {
      background-color: shade($medium-gray, 20%);
    }
  }

  &.danger,
  &.danger:disabled:hover {
    background-color: white;
    background-image: none;
    color: $hab-red;
  }

  &.confirm,
  &.confirm:disabled:hover {
    background-color: white;
    background-image: none;
    color: $hab-green;
  }

  &.small {
    font-size: 50%;
  }

  .hab-item-list & {
    box-shadow: none;
    font-size: rem(14);
    padding: rem(6) rem(12);

    &:hover {
      background-color: $hab-off-white;
    }
  }
}
